home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / compress / jrbzoo21.zoo / ar.h < prev    next >
C/C++ Source or Header  |  1991-09-25  |  3KB  |  136 lines

  1. /*$Source: /home/bammi/atari/minix/zoo21/RCS/ar.h,v $*/
  2. /*$Id: ar.h,v 1.19 1991/08/12 17:08:37 bammi Exp $*/
  3. /***********************************************************
  4.     ar.h
  5.  
  6. Adapted from "ar" archiver written by Haruhiko Okumura.
  7. ***********************************************************/
  8.  
  9. #include <stdio.h>
  10.  
  11. #ifdef ANSI_HDRS
  12. # include <limits.h>
  13. #endif
  14.  
  15. /* uchar should be 8 bits or more */
  16. /* typedef unsigned char  uchar;   -- already in zoo.h */
  17.  
  18. /*
  19.  * Hey HP listen up: why the hell dont you leave unix to people
  20.  * who know what they are doing. Stick to builing hardware and instruments.
  21.  *
  22.  */
  23. #ifndef __hpux
  24. typedef unsigned int   uint;    /* 16 bits or more */
  25. typedef unsigned short ushort;  /* 16 bits or more */
  26. #endif
  27. typedef unsigned long  ulong;   /* 32 bits or more */
  28.  
  29. /* T_UINT16 must be #defined in options.h to be 
  30. a 16-bit unsigned integer type */
  31.  
  32. #ifndef T_UINT16
  33. # include "T_UINT16 not defined"
  34. #endif
  35.  
  36. typedef T_UINT16          t_uint16;    /* exactly 16 bits */
  37.  
  38. #ifndef SEEK_SET
  39. # define SEEK_SET 0
  40. #endif
  41. #ifndef SEEK_CUR
  42. # define SEEK_CUR 1
  43. #endif
  44. #ifndef SEEK_END
  45. # define SEEK_END 2
  46. #endif
  47. #ifndef EXIT_SUCCESS
  48. # define EXIT_SUCCESS 0
  49. #endif
  50. #ifndef EXIT_FAILURE
  51. # define EXIT_FAILURE 1
  52. #endif
  53.  
  54. /* ar.c */
  55.  
  56. extern int unpackable;
  57. extern ulong origsize, compsize;
  58.  
  59. /* all the prototypes follow here for all files */
  60.  
  61. /* standard library functions */
  62. #ifndef ANSI_HDRS
  63.  extern void exit();
  64.  extern long ftell();
  65.  extern int fseek();
  66.  extern int strlen();
  67.  extern char *strchr();
  68.  extern char *strpbrk();
  69.  extern int strcmp();
  70.  extern char *strcpy();
  71.  extern int memcmp();
  72.  extern VOIDPTR malloc();
  73.  extern VOIDPTR memcpy();
  74. #endif /* ANSI_HDRS */
  75.  
  76. /* AR.C */
  77. int get_line PARMS((char *s , int n ));
  78. void exitfunc PARMS((int code));
  79. void dlog PARMS((char *fmt, ...));
  80. void d1log PARMS((char *fmt, ...));
  81. void outcf PARMS((FILE *stream, char *buf, int n));
  82. void c1log PARMS((char *buf, int n));
  83.  
  84. /* DECODE.C */
  85. void decode_start PARMS((void ));
  86. int decode PARMS((uint count , uchar buffer []));
  87.  
  88. /* ENCODE.C */
  89. void encode PARMS((FILE *, FILE *));
  90.  
  91. /* HUF.C */
  92. void output PARMS((uint c , uint p ));
  93. void huf_encode_start PARMS((void ));
  94. void huf_encode_end PARMS((void ));
  95. uint decode_c PARMS((void ));
  96. uint decode_p PARMS((void ));
  97. void huf_decode_start PARMS((void ));
  98.  
  99. /* IO.C */
  100. void make_crctable PARMS((void ));
  101. void fillbuf PARMS((int n ));
  102. uint getbits PARMS((int n ));
  103. void putbits PARMS((int n , uint x ));
  104. int fread_crc PARMS((uchar *p , int n , FILE *f ));
  105. void fwrite_crc PARMS((uchar *p , int n , FILE *f ));
  106. void init_getbits PARMS((void ));
  107. void init_putbits PARMS((void ));
  108.  
  109. /* MAKETBL.C */
  110. void make_table
  111.     PARMS((int nchar, uchar bitlen[], int tablebits, ushort table[]));
  112.  
  113. /* MAKETREE.C */
  114. int make_tree
  115.     PARMS((int nparm, ushort freqparm [], uchar lenparm [], ushort codeparm []));
  116.  
  117. /* delete */
  118.  
  119. #ifdef NEED_MEMMOVE
  120. # define MOVE_LEFT move_left
  121.   void move_left PARMS((char *, char *, int));
  122. #else
  123. # define MOVE_LEFT memmove
  124.  extern VOIDPTR memmove();
  125. #endif
  126.  
  127. #if 0
  128. /* global crc variable stuff for use by various routines */
  129. extern t_uint16 crc;
  130. #define INIT_CRC  0  /* CCITT: 0xFFFF */
  131. #endif
  132.  
  133. /* for lzh modules and also for ar.c to use in defining buffer size */
  134. #define DICBIT    13    /* 12(-lh4-) or 13(-lh5-) */
  135. #define DICSIZ ((unsigned) 1 << DICBIT)
  136.